<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			//求最值
			var arr = [7, 10, 6, 12, 3, 20];

			var x = 0;
			var max = arr[0];
			while (x < arr.length) {
				if (arr[x] > max) {
					max = arr[x];
				}
				x++;
			}

			// console.log("最大值:" + max);
			document.write("最大值:" + max);


			/* if (arr[0] > arr[1]) {

			} else {

			}
			
			if (arr[1] > arr[2]) {
			
			} else {
			
			}
			
			if (arr[1] > arr[3]) {
			
			} else {
			
			} */
		</script>
	</head>
	<body>
	</body>
</html>
